<?php
/**
 * Created by PhpStorm.
 * User: cyc
 * Date: 2017/11/2
 * Time: 下午6:00
 */

class MsggGlobalConfig extends ConfigDecorator
{

    const CONFIG_TYPE = 'global';
    const CONFIG_MERGE_CALL_SIZE = 'merge_call_size';
    const CONFIG_GET_MSG_STRATEGY = 'get_msg_strategy';
    const CONFIG_ADMIN_NAME = 'admin_name';
    const CONFIG_MERGE_MSG_DATE_CREATE = 'merge_msg_date_create';
    const CONFIG_ACTIVEMSG_DURATION = 'activemsg_duration';
    const CONFIG_IGNORE_SYNSSO_NAMES = 'ignore_synsso_names';
    const TASK_DOWNLOAD_PER_FILE_COUNT = 'task_download_per_file_count';

    private static $_globalConfig;


    public static function getGloabalConfigValue($key, $defalut)
    {
        $config = self::getInstance();
        return $config->getConfigValue($key,$defalut);

    }

    public static function getInstance()
    {
        if (empty(self::$_globalConfig)) {
            self::$_globalConfig = MsggConfig::readConfigs(new MsggGlobalReader());
        }
        return self::$_globalConfig;
    }


}